<?php
/**
 *	description:ZMAXWECHAT 帮助类实现文件
 *  author：min.zhang
 *  Email:zhang19min88@163.com
 *	Url:http://www.zmax99.com
 *  copyright:南宁市程序人软件科技有限责任公司保留所有权利
 *  date:2016-04-28
 *  @license GNU General Public License version 3, or later
 *  check date:2016-05-26
 *  checker :min.zhang
 */
 
defined('_JEXEC') or die('Restricted access');
 
class zmaxwechatHelper
{    
	static public  function addSubmenu($submenu)
	{		
		JHtmlSidebar::addEntry(JText::_('COM_ZMAXWECHAT_SUBMENU_MAIN'),
										'index.php?option=com_zmaxwechat&view=main',$submenu =='main');
		JHtmlSidebar::addEntry(JText::_('COM_ZMAXWECHAT_SUBMENU_MEDIAS'),
										'index.php?option=com_zmaxwechat&view=medias',$submenu == 'medias');
		JHtmlSidebar::addEntry(JText::_('COM_ZMAXWECHAT_SUBMENU_NEWSQUEUES'),
										'index.php?option=com_zmaxwechat&view=newsqueues',$submenu == 'newsqueues');
		JHtmlSidebar::addEntry(JText::_('COM_ZMAXWECHAT_SUBMENU_SENDEDS'),
										'index.php?option=com_zmaxwechat&view=sendeds',$submenu == 'sendeds');
		JHtmlSidebar::addEntry(JText::_('COM_ZMAXWECHAT_SUBMENU_MENUS'),
										'index.php?option=com_zmaxwechat&view=menus',$submenu == 'menus');
	}
	
	//当到当前表单的时间
	static public function getPostDate()
	{
		date_default_timezone_set('PRC');
		$date= date("Y-m-d H:i:s");
		$now = JDate::getInstance($date);
		return $now->toSql();
	}
	
	static public function formatMenuType($type)
	{
		$type=strtolower($type);
		switch($type)
		{
			case 'view':
				$type="跳转网页";break;
			case 'media_id':
				$type='图文消息';break;
			default:
				$type="未知";break;
		}
		return $type;
	}
}
?>